package com.mgq.generic;

/**
 * @author MaGuangQi
 * @description
 * @date 2021-12-24 15:31
 **/
public class MainClass {
    public static void main(String[] args) {
        GenericClass<String> generic = new GenericClass<>("hello world");
        System.out.println(generic.getKey());
        System.out.println(generic);
        System.out.println("--------------------------");
        GenericClass<Integer> genericClass = new GenericClass<>(100);
        System.out.println(genericClass.getKey());
        System.out.println(genericClass);

        //泛型类没有指定类型时,是Object类型
        GenericClass object = new GenericClass<>(100);

        System.out.println(generic.getClass());
        System.out.println(genericClass.getClass());

    }


}
